<{layout name="admin/layout/default" /}>
<div class="row" id="edit_permission" data-page="permission/edit">
    <div class="row">
        <div class="col-lg-12">
            <a class="btn btn-default" href="<{:url('admin/permission/list')}>">返回</a>
        </div>
    </div>

    <hr />
    <div class="row m-t">
        <div class="col-lg-4 col-lg-offset-4">
            <div class="form-group">
                <label>分组</label>
                <select class="form-control" v-model="group" name="group">
                    <option value="">请选择</option>
                    <option v-if="pageData.groups" v-for="opt in pageData.groups" :value="opt.id">{{opt.name}}</option>
                </select>
            </div>
        </div>
    </div>

    <div class="col-lg-12">
        <div class="row m-t">
            <div class="col-lg-4 col-lg-offset-4">
                <div class="form-group">
                    <label>名称</label>
                    <input type="text" class="form-control" v-model="name">
                </div>
            </div>
        </div>

        <div class="row m-t">
            <div class="col-lg-4 col-lg-offset-4">
                <div class="form-group">
                    <label>Uri</label>
                    <input type="text" name="auth[uri]" class="form-control" v-model="auth.uri">
                </div>
            </div>
        </div>

        <div class="row m-t">
            <div class="col-lg-4 col-lg-offset-4">
                <div class="form-group">
                    <label>方法 </label>
                    <label class="radio-inline">
                        <input type="radio" name="auth[method]" value="GET" v-model="auth.method">GET
                    </label>
                    <label class="radio-inline">
                        <input type="radio" name="auth[method]" value="POST" v-model="auth.method">POST
                    </label>
                    <label class="radio-inline">
                        <input type="radio" name="auth[method]" value="PUT" v-model="auth.method">PUT
                    </label>
                </div>
            </div>
        </div>

        <div class="row m-t">
            <div class="col-lg-4 col-lg-offset-4">
                <div class="form-group">
                    <label>状态 </label>
                    <label class="radio-inline">
                        <input type="radio" name="status" value="1" v-model="status">启用
                    </label>
                    <label class="radio-inline">
                        <input type="radio" name="status" value="2" v-model="status">禁用
                    </label>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-2 col-lg-offset-5 m-b-xl">
                <div class="btn btn-primary btn-block" @click="submit()">提交</div>
            </div>
        </div>
    </div>
</div>
